/* xx-ai 文件浏览器样式 */

body {
    background-color: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.navbar-brand {
    font-weight: 600;
}

.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border-radius: 0.5rem;
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #e9ecef;
    border-radius: 0.5rem 0.5rem 0 0 !important;
}

.breadcrumb {
    background-color: transparent;
    padding: 0;
    margin: 0;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: ">";
    color: #6c757d;
}

.table th {
    border-top: none;
    font-weight: 600;
    color: #495057;
}

.file-directory:hover {
    background-color: #fff3cd;
}

.file-item:hover {
    background-color: #f8f9fa;
}

/* 文件名样式 */
.file-name {
    font-weight: 500;
}

/* 图片文件名特殊样式 - 减小字体 */
.image-file-name {
    font-weight: 500;
    color: #198754 !important;
    text-decoration: none;
    font-size: 0.85rem;
}

.image-file-name:hover {
    color: #146c43 !important;
    text-decoration: underline;
}

/* 列表视图中图片文件名更小 */
.image-file-name.small {
    font-size: 0.8rem;
}

.btn-group-sm > .btn {
    font-size: 0.875rem;
}

.badge {
    font-size: 0.65rem;
}

.alert {
    border: none;
    border-radius: 0.5rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container-fluid {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
}

@media (max-width: 576px) {
    .navbar-brand {
        font-size: 1rem;
    }
    
    .card-title {
        font-size: 1rem;
    }
    
    .btn-group-sm > .btn {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
}

/* 图标样式 */
.bi-folder-fill {
    color: #ffc107 !important;
}

.bi-file-earmark {
    color: #0d6efd !important;
}

.bi-arrow-up-circle {
    color: #198754 !important;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 工具提示样式 */
.tooltip {
    font-size: 0.875rem;
}

/* 统计信息卡片 */
.bg-light {
    background-color: #f8f9fa !important;
    border: 1px solid #e9ecef;
}

/* 按钮样式优化 */
.btn-outline-secondary:hover {
    color: #fff;
    background-color: #6c757d;
    border-color: #6c757d;
}

/* 表格样式优化 */
.table-hover tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.075);
}

.table-info {
    background-color: #cff4fc;
}

/* 导航栏优化 */
.navbar-dark .navbar-nav .nav-link {
    color: rgba(255,255,255,.85);
}

.navbar-dark .navbar-nav .nav-link:hover {
    color: #fff;
}

/* 面包屑优化 */
.breadcrumb-item.active {
    font-weight: 500;
    color: #495057;
}

/* 下拉菜单优化 */
.dropdown-menu {
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border-radius: 0.5rem;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
}

/* 输入框组优化 */
.input-group-text {
    background-color: #e9ecef;
    border-color: #ced4da;
    color: #495057;
}

/* 文件类型图标颜色 */
.bi-file-earmark.text-primary {
    color: #0d6efd !important;
}

/* 隐藏文件样式 */
.file-hidden {
    opacity: 0.6;
    font-style: italic;
}

/* 错误状态样式 */
.text-danger {
    color: #dc3545 !important;
}

.text-warning {
    color: #ffc107 !important;
}

.text-success {
    color: #198754 !important;
}

/* 空状态样式 */
.empty-state {
    padding: 3rem 1rem;
    text-align: center;
    color: #6c757d;
}

.empty-state .bi {
    font-size: 4rem;
    margin-bottom: 1rem;
}

/* ================ 文件上传下载相关样式 ================ */

/* 文件上传区域 */
.upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-color: #0d6efd;
    background-color: #f8f9fa;
}

.upload-area.dragover {
    border-color: #0d6efd;
    background-color: #e7f3ff;
    transform: scale(1.02);
}

.upload-area .upload-icon {
    font-size: 3rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

.upload-area.dragover .upload-icon {
    color: #0d6efd;
}

/* 文件列表样式 */
.file-item-upload {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background-color: #fff;
    transition: all 0.2s ease;
}

.file-item-upload:hover {
    border-color: #0d6efd;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.file-item-upload .file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.file-item-upload .file-details {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.file-item-upload .file-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-item-upload .file-name {
    font-weight: 500;
    margin-bottom: 0;
}

.file-item-upload .file-size {
    color: #6c757d;
    font-size: 0.875rem;
}

.file-item-upload .file-actions {
    display: flex;
    gap: 0.25rem;
}

/* 上传进度样式 */
.upload-progress {
    margin-top: 1rem;
}

.upload-progress .progress {
    height: 0.5rem;
    border-radius: 0.25rem;
}

.upload-progress .progress-bar {
    transition: width 0.3s ease;
}

.upload-status {
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* 操作按钮样式 */
.action-buttons {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.action-buttons .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    line-height: 1;
}

.action-buttons .btn-sm {
    padding: 0.125rem 0.375rem;
}

/* 模态框样式优化 */
.modal-content {
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.modal-header {
    border-bottom: 1px solid #e9ecef;
    background-color: #f8f9fa;
}

.modal-footer {
    border-top: 1px solid #e9ecef;
    background-color: #f8f9fa;
}

/* 文件类型图标颜色 */
.file-icon-image {
    color: #28a745 !important;
}

.file-icon-document {
    color: #dc3545 !important;
}

.file-icon-archive {
    color: #ffc107 !important;
}

.file-icon-video {
    color: #6f42c1 !important;
}

.file-icon-audio {
    color: #20c997 !important;
}

.file-icon-code {
    color: #fd7e14 !important;
}

.file-icon-default {
    color: #6c757d !important;
}

/* 拖拽上传样式 */
.drag-drop-area {
    position: relative;
    overflow: hidden;
}

.drag-drop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(13, 110, 253, 0.1);
    border: 2px dashed #0d6efd;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 600;
    color: #0d6efd;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.drag-drop-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* 成功/错误消息样式 */
.alert {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.alert-success {
    background-color: #d1edff;
    color: #0c5460;
    border-left: 4px solid #198754;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border-left: 4px solid #ffc107;
}

/* 文件预览样式 */
.file-preview {
    max-width: 100%;
    max-height: 500px;
    border-radius: 0.375rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.text-preview {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    white-space: pre-wrap;
    overflow-x: auto;
    max-height: 500px;
}

/* 工具提示样式 */
.tooltip-inner {
    background-color: #333;
    color: #fff;
    border-radius: 0.375rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* 响应式设计优化 */
@media (max-width: 768px) {
    .action-buttons {
        flex-direction: column;
        gap: 0.125rem;
    }
    
    .action-buttons .btn {
        width: 100%;
        font-size: 0.75rem;
    }
    
    .file-item-upload .file-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .upload-area {
        padding: 1rem;
    }
    
    .upload-area .upload-icon {
        font-size: 2rem;
    }
}

@media (max-width: 576px) {
    .btn-group-sm > .btn {
        font-size: 0.7rem;
        padding: 0.125rem 0.25rem;
    }
    
    .modal-dialog {
        margin: 0.5rem;
    }
}

/* ================ 图片预览相关样式 ================ */

/* 图片预览模态框 */
.modal-lg {
    max-width: 90vw;
}

@media (min-width: 992px) {
    .modal-lg {
        max-width: 800px;
    }
}

/* 图片预览容器 */
#imageContainer {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

#previewImage {
    max-height: 70vh;
    max-width: 100%;
    height: auto;
    width: auto;
    object-fit: contain;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
    cursor: pointer;
}

#previewImage:hover {
    transform: scale(1.02);
}

/* 图片预览切换按钮 */
#prevImageBtn, #nextImageBtn {
    opacity: 0.7;
    transition: all 0.2s ease;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid #dee2e6;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

#prevImageBtn:hover, #nextImageBtn:hover {
    opacity: 1;
    background-color: white;
    transform: translateY(-50%) scale(1.1);
}

#prevImageBtn:focus, #nextImageBtn:focus {
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* 移动端适配 */
@media (max-width: 768px) {
    #prevImageBtn, #nextImageBtn {
        width: 36px;
        height: 36px;
        font-size: 0.8rem;
    }
}

@media (max-width: 576px) {
    #prevImageBtn, #nextImageBtn {
        width: 32px;
        height: 32px;
        font-size: 0.7rem;
    }
}

/* 加载动画 */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* 图片信息区域 */
#imageInfo {
    background-color: #f8f9fa;
    border-radius: 0.5rem;
    padding: 1rem;
    border: 1px solid #e9ecef;
}

#imageInfo .row {
    margin: 0;
}

#imageInfo .col-md-6 {
    padding: 0.25rem 0.5rem;
}

#imageInfo strong {
    color: #495057;
    font-weight: 600;
}

/* 错误状态 */
#imageError {
    color: #6c757d;
}

#imageError .bi {
    font-size: 4rem;
    margin-bottom: 1rem;
}

/* 模态框头部优化 */
.modal-header {
    border-bottom: 1px solid #e9ecef;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.modal-header .btn-close {
    filter: invert(1);
}

.modal-header .modal-title {
    font-weight: 600;
}

.modal-header .modal-title .bi {
    margin-right: 0.5rem;
}

/* 模态框尾部优化 */
.modal-footer {
    border-top: 1px solid #e9ecef;
    background-color: #f8f9fa;
}

.modal-footer .btn {
    margin-left: 0.5rem;
}

/* 按钮状态优化 */
.btn-outline-success:hover {
    color: #fff;
    background-color: #198754;
    border-color: #198754;
}

.btn-outline-info:hover {
    color: #fff;
    background-color: #0dcaf0;
    border-color: #0dcaf0;
}

/* 图片操作按钮组 */
.image-actions {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.image-actions .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    line-height: 1;
    border-radius: 0.25rem;
}

/* 图片预览样式 - 优化网格视图中的图片显示 */
.thumbnail-preview {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 0.375rem;
    border: 1px solid #dee2e6;
    margin-right: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.1);
}

/* 列表视图中的小缩略图 - 优化为更大显示 */
.thumbnail-small {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 0.375rem;
    border: 1px solid #dee2e6;
    margin-right: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.1);
}

/* 网格视图中的缩略图容器 - 优化为更大显示 */
.image-thumbnail-container {
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    overflow: hidden;
    background-color: #f8f9fa;
    border: 2px solid #e9ecef;
    position: relative;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

/* 网格视图中的缩略图 - 增强视觉效果 */
.image-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
    border-radius: 0.375rem;
}

.image-thumbnail:hover {
    transform: scale(1.05);
}

/* 鼠标悬停时显示边框高亮 */
.image-thumbnail-container:hover {
    border-color: #198754;
    box-shadow: 0 0.375rem 0.75rem rgba(25, 135, 84, 0.2);
}

/* 移动端按钮触摸优化 */
@media (max-width: 768px) {
    .btn-sm {
        min-height: 44px;
        min-width: 44px;
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    .btn-group-sm > .btn {
        min-height: 44px;
        min-width: 44px;
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    /* 确保操作按钮在移动端可见和可点击 */
    .grid-item-actions .btn {
        min-height: 40px;
        min-width: 40px;
        padding: 0.5rem;
        font-size: 0.875rem;
        border-width: 2px;
    }
    
    /* 列表视图操作按钮优化 */
    .table .btn-group-sm .btn {
        min-height: 40px;
        min-width: 40px;
        padding: 0.5rem;
        margin: 0.125rem;
    }
    
    /* 移动端触摸反馈 */
    .grid-item {
        -webkit-tap-highlight-color: rgba(0, 123, 255, 0.2);
        cursor: pointer;
        touch-action: manipulation;
    }
    
    .grid-item:active {
        background-color: rgba(0, 123, 255, 0.1);
        transform: scale(0.98);
        transition: all 0.1s ease;
    }
    
    /* 移动端按钮点击反馈 */
    .btn:active {
        transform: scale(0.95);
        transition: transform 0.1s ease;
    }
    
    /* 移动端防止意外缩放 */
    .grid-item-actions .btn:active {
        transform: scale(0.9);
    }
}

/* 缩略图加载状态 */
.image-thumbnail-container::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid #dee2e6;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.image-thumbnail-container.loading::before {
    opacity: 1;
}

/* 图片文件特殊样式 */
.grid-item.image-file {
    background: linear-gradient(135deg, #f8fff8 0%, #e8f5e8 100%);
    border-color: #d4edda;
}

.grid-item.image-file:hover {
    border-color: #198754;
    box-shadow: 0 0.25rem 0.5rem rgba(25, 135, 84, 0.2);
}

.grid-item.image-file .grid-item-title {
    color: #198754;
    font-weight: 500;
}

/* 视频文件特殊样式 */
.grid-item.video-file {
    background: linear-gradient(135deg, #f8f8ff 0%, #e8e8f5 100%);
    border-color: #d4d4ed;
}

.grid-item.video-file:hover {
    border-color: #0d6efd;
    box-shadow: 0 0.375rem 0.75rem rgba(13, 110, 253, 0.2);
}

.grid-item.video-file .grid-item-title {
    color: #0d6efd;
    font-weight: 500;
}

/* 缩略图错误处理 */
.thumbnail-error {
    display: none;
    color: #6c757d;
    font-size: 0.75rem;
    text-align: center;
}

.image-thumbnail-container .thumbnail-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* 响应式设计 - 保持图片较大显示 */
@media (max-width: 768px) {
    .image-thumbnail-container {
        width: 90px;
        height: 90px;
    }
    
    .thumbnail-preview {
        width: 40px;
        height: 40px;
    }
    
    .thumbnail-small {
        width: 36px;
        height: 36px;
    }
}

@media (max-width: 576px) {
    .image-thumbnail-container {
        width: 75px;
        height: 75px;
    }
    
    .thumbnail-preview {
        width: 32px;
        height: 32px;
    }
    
    .thumbnail-small {
        width: 28px;
        height: 28px;
    }
}

/* 图片预览按钮标识 */
.image-file {
    position: relative;
}

.image-file::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background-color: #28a745;
    border-radius: 50%;
    border: 2px solid #fff;
}

/* 高亮显示图片文件 */
.file-item.image-file .file-name {
    color: #28a745;
    font-weight: 500;
}

/* 响应式设计优化 */
@media (max-width: 768px) {
    .modal-lg {
        max-width: 95vw;
        margin: 0.25rem;
    }
    
    #previewImage {
        max-height: 60vh;
    }
    
    #imageInfo .col-md-6 {
        margin-bottom: 0.5rem;
    }
    
    .modal-footer {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .modal-footer .btn {
        width: 100%;
        margin-left: 0;
    }
}

@media (max-width: 576px) {
    .spinner-border {
        width: 2rem;
        height: 2rem;
    }
    
    #imageInfo {
        padding: 0.75rem;
    }
    
    .modal-header .modal-title {
        font-size: 1rem;
    }
}

/* ================ 网格视图相关样式 ================ */

/* 视图切换按钮 */
.view-toggle-btn {
    min-width: 70px;
}

.view-toggle-btn.active {
    background-color: #0d6efd !important;
    color: white !important;
    border-color: #0d6efd !important;
}

/* 网格项目容器 */
.grid-item-container {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 1rem;
}

/* 网格项目 - 调整高度以适应更大的图片 */
.grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    min-height: 180px;
    height: 100%;
}

.grid-item:hover {
    border-color: #0d6efd;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.grid-item.directory-item:hover {
    border-color: #ffc107;
    box-shadow: 0 0.25rem 0.5rem rgba(255, 193, 7, 0.2);
}

.grid-item.file-item:hover {
    border-color: #0d6efd;
    box-shadow: 0 0.25rem 0.5rem rgba(13, 110, 253, 0.2);
}

/* 上级目录项 */
.grid-item.parent-dir {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border-color: #1976d2;
    color: #1976d2;
    font-weight: 600;
    margin-right: 1rem;
    max-width: 160px;
}

.grid-item.parent-dir:hover {
    background: linear-gradient(135deg, #bbdefb 0%, #e1bee7 100%);
    transform: translateY(-3px);
}

/* 网格项目图标 - 为图片预留更多空间 */
.grid-item-icon {
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 80px;
}

.grid-item-icon .bi {
    font-size: 3rem;
    transition: transform 0.2s ease;
}

.grid-item:hover .grid-item-icon .bi {
    transform: scale(1.1);
}

/* 网格项目标题 - 缩小字体，减少行数 */
.grid-item-title {
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
    line-height: 1.1;
    margin-bottom: 0.125rem;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    word-break: break-word;
    color: #495057;
}

/* 网格项目信息 - 进一步缩小 */
.grid-item-info {
    font-size: 0.65rem;
    color: #6c757d;
    text-align: center;
    margin-bottom: 0.25rem;
}

/* 网格项目操作按钮 - 优化移动端显示 */
.grid-item-actions {
    position: absolute;
    bottom: 0.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.2s ease;
    background-color: rgba(255, 255, 255, 0.95);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.1);
}

.grid-item:hover .grid-item-actions {
    opacity: 1;
}

/* 移动端始终显示操作按钮 */
@media (max-width: 768px) {
    .grid-item-actions {
        opacity: 1;
        position: static;
        transform: none;
        margin-top: 0.25rem;
        justify-content: center;
        background-color: transparent;
        padding: 0;
        box-shadow: none;
    }
}

.grid-item-actions .btn {
    padding: 0.125rem 0.25rem;
    font-size: 0.75rem;
    line-height: 1;
    border-radius: 0.25rem;
    min-width: 28px;
    min-height: 28px;
}

/* 文件类型特定样式 */
.grid-item.directory-item .grid-item-title {
    color: #856404;
    font-weight: 600;
}

/* 网格视图中图片文件的特殊样式 - 突出图片 */
.grid-item.file-item.image-file {
    background: linear-gradient(135deg, #f8fff8 0%, #e8f5e8 100%);
    border: 2px solid #d4edda;
}

.grid-item.file-item.image-file:hover {
    border-color: #198754;
    box-shadow: 0 0.375rem 0.75rem rgba(25, 135, 84, 0.25);
    transform: translateY(-3px);
}

.grid-item.file-item.image-file .grid-item-title {
    color: #198754;
    font-weight: 600;
}

.grid-item.file-item.text-file {
    background: linear-gradient(135deg, #f0f8ff 0%, #e6f3ff 100%);
}

.grid-item.file-item.text-file .grid-item-title {
    color: #0d6efd;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .row-cols-lg-6 {
        --bs-columns: 5;
    }
}

@media (max-width: 992px) {
    .row-cols-md-4 {
        --bs-columns: 3;
    }
    
    .grid-item {
        min-height: 160px;
        padding: 0.75rem;
    }
    
    .grid-item-icon .bi {
        font-size: 2.5rem;
    }
    
    .grid-item-icon {
        height: 70px;
    }
}

@media (max-width: 768px) {
    .row-cols-sm-3 {
        --bs-columns: 2;
    }
    
    .grid-item {
        min-height: 140px;
        padding: 0.5rem;
    }
    
    .grid-item-icon .bi {
        font-size: 2rem;
    }
    
    .grid-item-icon {
        height: 60px;
    }
    
    .grid-item-title {
        font-size: 0.7rem;
    }
    
    .grid-item-info {
        font-size: 0.6rem;
    }
    
    .grid-item.parent-dir {
        max-width: 140px;
    }
}

/* 移动端网格项目操作按钮优化 */
@media (max-width: 576px) {
    .row-cols-2 {
        --bs-columns: 2;
    }
    
    .grid-item {
        min-height: 140px;
        padding: 0.375rem;
    }
    
    .grid-item-icon .bi {
        font-size: 1.75rem;
    }
    
    .grid-item-icon {
        height: 50px;
    }
    
    .grid-item-title {
        font-size: 0.65rem;
    }
    
    .grid-item-info {
        font-size: 0.55rem;
    }
    
    .grid-item-actions {
        flex-direction: row;
        gap: 0.25rem;
        flex-wrap: wrap;
    }
    
    .grid-item-actions .btn {
        font-size: 0.7rem;
        padding: 0.25rem 0.375rem;
        min-width: 32px;
        min-height: 32px;
        margin: 0.125rem;
    }
}

/* 无数据状态 */
#gridView .text-center {
    padding: 3rem 1rem;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.grid-item {
    animation: fadeIn 0.3s ease;
}

/* 网格项目选中状态 */
.grid-item.selected {
    border-color: #0d6efd;
    background-color: #e7f3ff;
    box-shadow: 0 0.25rem 0.5rem rgba(13, 110, 253, 0.2);
}

/* 文件大小显示优化 */
.grid-item-info .file-size {
    font-weight: 500;
    color: #495057;
}

/* 网格视图整体容器 */
#gridView {
    padding: 1rem 1.5rem;
}

#gridView .row {
    margin: 0 -0.5rem;
}

#gridView .col {
    padding: 0 0.5rem;
    margin-bottom: 1rem;
}

/* 为图片文件增加特殊的网格布局优化 */
.grid-item.image-file .grid-item-icon {
    height: 100px;
    margin-bottom: 0.125rem;
}

/* 移动设备上的图片优化 */
@media (max-width: 768px) {
    .grid-item.image-file .grid-item-icon {
        height: 80px;
    }
    
    .grid-item.image-file {
        min-height: 160px;
    }
    
    /* 移动端触摸优化 */
    .grid-item {
        -webkit-tap-highlight-color: rgba(0, 123, 255, 0.2);
        cursor: pointer;
    }
    
    .grid-item:active {
        background-color: rgba(0, 123, 255, 0.1);
        transform: scale(0.98);
    }
    
    /* 图片预览模态框移动端优化 */
    .modal-lg {
        max-width: 95vw;
        margin: 0.25rem;
    }
    
    #previewImage {
        max-height: 60vh;
    }
    
    #imageInfo .col-md-6 {
        margin-bottom: 0.5rem;
    }
    
    .modal-footer {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .modal-footer .btn {
        width: 100%;
        margin-left: 0;
        padding: 0.75rem;
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .grid-item.image-file .grid-item-icon {
        height: 65px;
    }
    
    .grid-item.image-file {
        min-height: 140px;
    }
}

/* 网格视图中的缩略图 - 增强视觉效果 */
.image-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
    border-radius: 0.375rem;
}

.image-thumbnail:hover {
    transform: scale(1.05);
}

/* 鼠标悬停时显示边框高亮 */
.image-thumbnail-container:hover {
    border-color: #198754;
    box-shadow: 0 0.375rem 0.75rem rgba(25, 135, 84, 0.2);
}